package com.youth.userservice;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableFeignClients      /*实现feign的远程调用*/
@SpringBootApplication   /*启动类*/
@EnableDiscoveryClient   /*nacos注册*/
@EnableSwagger2   /*开启swagger2调试*/
@ComponentScan(basePackages = {"com.youth"})           /*扫描*/
@MapperScan("com.youth.userservice.mapper")           //mapper扫描
public class ServiceUcApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceUcApplication.class,args);
    }


    /**
     * mybatisplus的分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

}